package com.itheima.mapper;


import com.itheima.pojo.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface EmpMapper {
//   @Select("select e.* ,d.name dept_name from emp e left join dept d on e.dept_id=d.id limit #{skip},#{pageSize}")
//    List<Emp> findPage(@Param("skip") Integer  skip, @Param("pageSize") Integer pageSize);
//
//   @Select("select  count(*) from emp")
//    Long findCount();
@Select("select e.* ,d.name dept_name from emp e left join dept d on e.dept_id=d.id")
    List<Emp> list();

    @Options(useGeneratedKeys = true, keyProperty = "id")
   // @Insert("insert into emp(username,  name,password, gender, phone, job, salary, image, entry_date, dept_id, create_time, update_time) " +
          //  "values (#{username},#{name},#{password},#{gender},#{phone},#{job},#{salary},#{image},#{entryDate},#{deptId},#{createTime},#{updateTime})")
    void insert(Emp emp);

    void deleteByIds(List<Integer> ids);
    @Select("select * from emp where id=#{id}")
    Emp getById(Integer id);


    void updateById(Emp emp);




    List<Map> emJobData();

    List<Map> empGenderData();
}